package cn.edu.hit.ht.controller.projectlist;

import cn.edu.hit.ht.serviceImpl.ProjectListService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/ProjectList")
public class ProjectListController {
    @Autowired
    ProjectListService projectListService;

    @RequestMapping(value="/Query",method=RequestMethod.GET)
    public String query(Model model, HttpServletRequest request ){
        model.addAttribute("title", "项目类型管理");

        /*PageHelper.startPage(1,5);
       List projectlists = projectListService.selectAllProjectlist();

        PageInfo pageInfo = new PageInfo(projectlists);

        model.addAttribute("pageInfo",pageInfo);
        */

       List projectlists = projectListService.selectAllProjectlist();
        //System.out.println(projectlists);

        return "projectlist/QueryProjectList";
    }

}
